<template>
	<view class="content"
		:style="'background: url('+ c_imgPath + 'mine/indexBg.png'+ ') repeat-y 0 0 / 100% auto;'">
		<view class="header">
			<view class="qiehuan">
				<view @click="getlist(i)" v-for="(v,i) in arr" :key="i">
					<view :class="show==i?'xzs':'wzs'">{{v}}</view>
					<view class="qiehuan_line" v-if="show==i">
						<image :src="c_imgPath+'mine/text_bom.png'"></image>
					</view>
				</view>
			</view>
		</view>
		<!-- 内容 -->
		<mescroll-body ref="mescrollRef" @init="mescrollInit" :down="downOption" @down="downCallback" @up="upCallback">
			<view class="coupon">
				<view v-for="(item,index) in listData" :key="index"
					:style="'border:'+ (index==listData.length-1?'none':'') " class="coupon_item">
					<view class="coupon_item_1">
						<view>{{item.content}}</view>
						<view>{{item.addtime}}</view>
					</view>
					<view class="coupon_r">{{item.change_money}}</view>
				</view>
			</view>
		</mescroll-body>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				c_imgPath:'https://qt.yhemall.com/',
				arr: ['全部', '充值', '消费', '打包'],
				show: 0,
				listData: [],

				// 是否显示参与
				downOption: {
					auto: false
				},

			}
		},
		onLoad(e) {

		},
		methods: {

			getlist(v) {
				this.show = v;
				this.aixuanArr = []
				this.mescroll.resetUpScroll()
			},


			/*下拉刷新的回调 */
			downCallback() {
				this.mescroll.resetUpScroll()
			},
			/*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
			upCallback(page) {
				//联网加载数据
				this.loadData(page.num);
			},
			loadData(pageNo) {
				// 模拟接口
				let that = this;
				that.req({
					url: 'profitMoney',
					Loading: true,
					data: {
						page: pageNo,
						type: that.show
					},
					success(res) {
						that.mescroll.endByPage(res.data.data.length, res.data.last_page);
						if (pageNo == 1) {
							that.listData = res.data.data;
						} else {
							that.listData = that.listData.concat(res.data.data);
						}

					}
				})
			},


		}
	}
</script>

<style>
	.coupon_r>image {
		width: 32rpx;
		height: 32rpx;
		margin-left: 10rpx;
	}

	.coupon_r {
		font-size: 32rpx;
		/* font-family: 'zcq'; */
		color: #B07CDD;
	}

	.coupon_item_1>view:nth-of-type(2) {
		font-size: 24rpx;
		color: rgba(255, 255, 255, 0.6);
		margin-top: 10rpx;
	}

	.coupon_item_1>view:nth-of-type(1) {
		font-size: 28rpx;
		font-weight: bold;
		color: #FFFFFF;
	}

	.coupon_item {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 20rpx;
		box-sizing: border-box;
		border: 1px solid;
		border-image: linear-gradient(0deg, #5D5868, #92949A) 10 10;
		background: linear-gradient(0deg, #2D2C4A 0%, #48495B 100%);
		margin-bottom: 20rpx;
		border-radius: 10rpx;
	}

	.coupon {
		width: 690rpx;
		margin: 20rpx auto;
		padding-top: 30rpx;
		/* 	background: #11141D;
		box-shadow: 0px 0px 10rpx 0px rgba(150, 255, 254, 0.7);
		padding: 0 30rpx; */
		box-sizing: border-box;
		/* border-radius: 20rpx; */
	}

	.qiehuan {
		display: flex;
		justify-content: space-between;
		/* align-items: center; */
		margin-top: 16rpx;
		width: 400rpx;
	}

	.qiehuan_line {
	}

	.qiehuan_line>image {
		width: 94rpx;
		height: 24rpx;
	}

	.qiehuan>view {
		flex: 1;
		text-align: center;
	}

	.wzs {
		font-size: 28rpx;
		font-family: Source Han Sans CN;
		font-weight: 500;
		color: #9E99E3;
	}

	.xzs {
		font-size: 32rpx;
		background: linear-gradient(0deg, #B75AFF 0%, #E7CBFF 100%);
		-webkit-background-clip: text;
		-webkit-text-fill-color: transparent;
		font-weight: bold;
	}

	.header {
		width: 750rpx;
		/* height: 176rpx; */
		padding-bottom: 30rpx;
		background: #09081C;
		font-size: 28rpx;
		color: #333333;
		box-sizing: border-box;
		position: fixed;
		/* #ifdef MP */
		top: 0;
		/* #endif */
		/* #ifndef MP */
		top: 88rpx;
		/* #endif */
		z-index: 15;
	}

	.content {
		width: 100vw;
		min-height: 100vh;
		padding-top: 88rpx;
		background: #09081C;
		box-sizing: border-box;
	}
</style>
